<?php if(!defined('ROOT_PATH')) exit('Access Denied');?>
<?php include self::template_compile(header); ?>

<div id="page" class="wrap">
  <h2>文章列表</h2>
  <div class="panel">
    <div class="code">
      <ul class="artlist">
        <?php if(is_array($demodata)) foreach($demodata AS $vlaue) { ?>
        <li><span>[<?php echo $vlaue["date"];?>]</span><?php echo $vlaue["id"];?>.<?php echo $vlaue["title"];?></li>
        <?php } ?>

      </ul>
      <?php if($page["total_count"]>0) { ?><!--分页开始-->
      <ul class="topage">
        <div>
          <table width="100%" border="0" cellpadding="5" cellspacing="0">
            <tr>
              <td valign="bottom" align="left" nowrap="true" style="width:40%;">总记录: <?php echo $page["total_count"];?>  页码:<?php echo $page["current_page"];?>/<?php echo $page["total_page"];?>  每页：<?php echo $page["page_size"];?></td>
              <td valign="bottom" align="right" nowrap="true" class="" style="width:60%;"> <?php if($page["current_page"] != $page["first_page"]) { ?> <a style="margin-right:5px;" href="<?php echo APP;?>index.php/Index/lists/p/<?php echo $page["first_page"];?>">首页</a> <a style="margin-right:5px;" href="<?php echo APP;?>index.php/Index/lists/p/<?php echo $page["prev_page"];?>">上一页</a><?php } ?>
                <?php if(is_array($page["all_pages"])) foreach($page["all_pages"] AS $vlaue) { ?>
                <?php if($vlaue != $page["current_page"]) { ?> <a style="margin-right:5px;font-weight:Bold;" href="<?php echo APP;?>index.php/Index/lists/p/<?php echo $vlaue;?>"><?php echo $vlaue;?></a> <?php } else { ?> <span style="margin-right:5px;font-weight:Bold; color:#82BA09;"><?php echo $vlaue;?></span> <?php } ?>
                <?php } ?>

                <?php if($page["current_page"] != $page["last_page"]) { ?> <a style="margin-right:5px;" href="<?php echo APP;?>index.php/Index/lists/p/<?php echo $page["next_page"];?>">下一页</a> <a  style="margin-right:5px;" href="<?php echo APP;?>index.php/Index/lists/p/<?php echo $page["last_page"];?>">尾页</a></td>
              <?php } ?> </tr>
          </table>
        </div>
      </ul>
      <?php } ?><!--分页结束--> 
    </div>
  </div>
</div>

<?php include self::template_compile(footer); ?>
